﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExcelImport.aspx.cs" Inherits="ZX.WebApp.Account.ExcelImport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body
        {
            margin: 10px;

            font-family: 宋体;
            font-size: 13px;
            width: 350px;
        }
        /* Table样式 */
        .tableContent
        {
            width: 320px;
            border-collapse: collapse;
        }
        .tableContent td
        {
            white-space: nowrap;
            line-height: 26px;
            text-align: left;
            border-bottom: solid 1px #d6e6fa;
            border-top: solid 1px #d6e6fa;
            border-left: solid 1px #d6e6fa;
            border-right: solid 1px #d6e6fa;
            padding: 0px 6px 0px 5px;
        }
        div.main_container
        {
            width: 320px;
            position: relative;
            text-align: left;
            height: 120px;
        }
    </style>
    <script type="text/javascript">
        function getvalue() {
            var sd = document.getElementById('<%=fpReport.ClientID%>');
            document.getElementById("HiddenField1").value = sd.value;
        }
        function checkFileExtension(elem) {
            var filePath = elem.value;
            if (filePath.indexOf('.') == -1)
                return false;
            var validExtensions = new Array();
            var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
            validExtensions[0] = 'xls';
            validExtensions[1] = 'xlsx';
            for (var i = 0; i < validExtensions.length; i++) {
                if (ext == validExtensions[i])
                    return true;
            }
            alert('您选择的文件格式为： ' + ext.toUpperCase() + ' 暂不支持!');
            return false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>--%>
        
        <div class="main_container">
            <asp:HiddenField ID="HiddenField1" runat="server" />
            <table style="width: 350px;" class="tableContent">
                <tr>
                    <td colspan="2" style="text-align: center; height: 30px;">
                        Excel数据导入数据库
                    </td>
                </tr>
                <tr>
                    <td style="text-align: left; height: 20px;">
                        <asp:Label ID="Label4" runat="server" Text="选择导入操作"></asp:Label>
                    </td>
                    <td style="text-align: left">
                    <asp:DropDownList ID="drpReport" runat="server" Width="155" AutoPostBack="True">
                        <asp:ListItem Value="00">--选择导入类型--</asp:ListItem>
                        <asp:ListItem Value="OutUser">外部客户导入</asp:ListItem>
                        <asp:ListItem Value="InUser">内部客户导入</asp:ListItem>
                    </asp:DropDownList>
                </td>
                </tr>
                <tr>
                    <td style="text-align: left; height: 30px;">
                        <asp:Label ID="Label2" runat="server" Text="选择导入文件"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:FileUpload ID="fpReport" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td style="text-align: left; height: 25px;">
                        &nbsp;
                    </td>
                    <td style="text-align: left">
                        <asp:Button ID="btnOK" runat="server" Text="确定导入" OnClientClick="getvalue()" 
                            onclick="btnOK_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center; color: Red;">
                        <asp:Label ID="lblMsg" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
        </div>

        <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
    </div>
    </form>
</body>
</html>
